home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / xserver-xorg-input-wacom.preinst < prev    next >
Encoding:
Text File  |  2009-04-07  |  2.2 KB  |  77 lines

  1. #!/bin/sh -e
  2. # This script can be called in the following ways:
  3. #
  4. # Before the package is installed:
  5. #    <new-preinst> install
  6. #
  7. # Before removed package is upgraded:
  8. #    <new-preinst> install <old-version>
  9. #
  10. # Before the package is upgraded:
  11. #    <new-preinst> upgrade <old-version>
  12. #
  13. #
  14. # If postrm fails during upgrade or fails on failed upgrade:
  15. #    <old-preinst> abort-upgrade <new-version>
  16.  
  17.  
  18. # Remove a no-longer used conffile
  19. rm_conffile()
  20. {
  21.     CONFFILE="$1"
  22.  
  23.     if [ -e "$CONFFILE" ]; then
  24.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  25.         old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE '{s/ obsolete$//;s/.* //;p}}\" /var/lib/dpkg/status`"
  26.         if [ "$md5sum" != "$old_md5sum" ]; then
  27.             echo "Obsolete conffile $CONFFILE has been modified by you, renaming to .dpkg-bak"
  28.             mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
  29.     else
  30.         rm -f "$CONFFILE"
  31.     fi
  32.     fi
  33. }
  34.  
  35.  
  36. case "$1" in
  37.     install|upgrade)
  38.     rm_conffile /etc/init.d/xserver-xorg-input-wacom
  39.     ;;
  40.  
  41.     abort-upgrade)
  42.     ;;
  43.  
  44.     *)
  45.     echo "$0 called with unknown argument \`$1'" 1>&2
  46.     exit 1
  47.     ;;
  48. esac
  49.  
  50. # Automatically added by dh_installudev
  51. if [ "$1" = install ] || [ "$1" = upgrade ]; then
  52.     if [ -e "/etc/udev/xserver-xorg-input-wacom.rules" ]; then
  53.         if [ "`md5sum \"/etc/udev/xserver-xorg-input-wacom.rules\" | sed -e \"s/ .*//\"`" = \
  54.              "`dpkg-query -W -f='${Conffiles}' xserver-xorg-input-wacom | sed -n -e \"\\\\' /etc/udev/xserver-xorg-input-wacom.rules's/.* //p\"`" ]
  55.         then
  56.             rm -f "/etc/udev/xserver-xorg-input-wacom.rules"
  57.         fi
  58.     fi
  59.     if [ -L "/lib/udev/rules.d/40-xserver-xorg-input-wacom.rules" ]; then
  60.         rm -f "/lib/udev/rules.d/40-xserver-xorg-input-wacom.rules"
  61.     fi
  62. fi
  63. # End automatically added section
  64. # Automatically added by dh_installudev
  65. if [ "$1" = install ] || [ "$1" = upgrade ]; then
  66.     if [ -e "/etc/udev/rules.d/50-xserver-xorg-input-wacom.rules" ]; then
  67.         if [ "`md5sum \"/etc/udev/rules.d/50-xserver-xorg-input-wacom.rules\" | sed -e \"s/ .*//\"`" = \
  68.              "`dpkg-query -W -f='${Conffiles}' xserver-xorg-input-wacom | sed -n -e \"\\\\' /etc/udev/rules.d/50-xserver-xorg-input-wacom.rules's/.* //p\"`" ]
  69.         then
  70.             rm -f "/etc/udev/rules.d/50-xserver-xorg-input-wacom.rules"
  71.         fi
  72.     fi
  73. fi
  74. # End automatically added section
  75.  
  76. exit 0
  77.